package org.example.infrastructure.item.gatewayimpl.database.dataobject;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.example.infrastructure.common.base.BaseDO;

/**
 * 商品表
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "item")
public class ItemDO extends BaseDO<Long> {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 商品名称
     */
    @TableField(value = "item_name")
    private String itemName;

    /**
     * 介绍
     */
    @TableField(value = "introduction")
    private String introduction;

    /**
     * 成本价(单位：分)
     */
    @TableField(value = "cost_price")
    private Long costPrice;

    /**
     * 售价(单位：分)
     */
    @TableField(value = "sale_price")
    private Long salePrice;

    @Override
    public Long getPrimaryId() {
        return id;
    }

    @Override
    public void setPrimaryId(Long id) {
        this.id = id;
    }
}